#pragma once
#include <d3dx9.h>
#include <d3d9.h>

class DirectX
{
public:
	DirectX(void);
	~DirectX(void);
	
	int InitDirect3D(int ScreenWidth, int ScreenHeight);
	int InitDirectSound();
	int InitDirectInput();

	LPDIRECT3DSURFACE9 getBackBuffer();
	LPDIRECT3DDEVICE9 getDevice();
	LPD3DXSPRITE getSpriteHandler();

	void setHandle(HWND hWnd);

	//Utilities
	LPDIRECT3DSURFACE9 LoadSurface(LPCSTR filePath,D3DCOLOR transparentColor);
	LPDIRECT3DTEXTURE9 LoadTexture(LPCSTR filePath,D3DCOLOR transparentColor);

	void RenderSurface(LPDIRECT3DSURFACE9 surface);

private:
	LPDIRECT3D9 _d3d;
	LPDIRECT3DDEVICE9 _d3ddev;
	LPDIRECT3DSURFACE9 _backbuffer;
	HWND _hWnd;
	LPD3DXSPRITE _spriteHandler;
};